import { request } from "../request";

//#region dataviewproject
export const apiDataViewProjectAddPost = (data:any)=>{
    return request({
        url: '/api/dataViewProject/add',
        method: 'post',
        data
    })
}

export const apiDataViewProjectPagePost = (data:any)=>{
    return request({
        url: '/api/dataViewProject/page',
        method: 'post',
        data
    })
}

export const apiDataViewProjectDeletePost = (data:any)=>{
    return request({
        url: '/api/dataViewProject/delete',
        method: 'post',
        data
    })
}

export const apiDataViewProjecUpdatePost = (data:any)=>{
    return request({
        url: '/api/dataViewProject/update',
        method: 'post',
        data
    })
}

//#endregion

//#region dataviewprojectdata
export const getProjDetailByIdAPI = (data:any)=>{
    return request({
        url: '/api/dataViewProjectData/detailById',
        method: 'post',
        data
    })
}

export const setProjectDataAPi = (data:any)=>{
    return request({
        url: '/api/dataViewProjectData/setProjectData',
        method: 'post',
        data
    })
}

export const uploadProjCoverAPI = (file:File)=>{
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/api/dataViewProjectData/uploadProjCover',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

export const uploadBgCoverAPI = (file:File,id:any)=>{
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url:'/api/dataViewProjectData/uploadBgCover',
        method:"POST",
        data:formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
//#endregion